package Layouts;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.Toolkit;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import java.awt.FlowLayout;
import javax.swing.JTextField;
import javax.swing.JList;
import javax.swing.JTabbedPane;
import java.awt.Canvas;
import javax.swing.JToggleButton;
import java.awt.Panel;
import javax.swing.JButton;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.ScrollPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLayeredPane;
import java.awt.CardLayout;


import java.awt.BorderLayout;
import java.awt.SystemColor;

public class Gerente extends JFrame {

	private JPanel contentPane;

	public Gerente() {
		
		
		setTitle("SuperMarket JRM - Gerente");
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 840, 497);
		
		ImageIcon icone = new ImageIcon(this.getClass().getResource("/Image/carrinho.png"));
		setIconImage(icone.getImage());
		setIconImage(icone.getImage());

		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JPanel menuPrincipal = new JPanel();
		JPanel panelMenuPrincipal = new JPanel();
		Border panelMenuPrincipalBorder = BorderFactory.createTitledBorder("Menu Principal");
		panelMenuPrincipal.setBorder(panelMenuPrincipalBorder);
		
		final JPanel tabelaMenuPrincipal = new JPanel();
		tabelaMenuPrincipal.setBackground(SystemColor.control);
		tabelaMenuPrincipal.setVisible(true);
		
		final JPanel panelMensagens = new JPanel();
		Border panelMensagensBorder = BorderFactory.createTitledBorder("Mensagens do Sistema");
		panelMensagens.setBorder(panelMensagensBorder);		
		
		
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()
					.addComponent(menuPrincipal, GroupLayout.PREFERRED_SIZE, 285, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(tabelaMenuPrincipal, GroupLayout.DEFAULT_SIZE, 513, Short.MAX_VALUE)
					.addContainerGap())
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addComponent(tabelaMenuPrincipal, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(menuPrincipal, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
					.addGap(9))
		);
		panelMensagens.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		
		JButton btnNewButton = new JButton("New button");
		panelMensagens.add(btnNewButton);
		
		JButton btnNewButton_1 = new JButton("New button");
		panelMensagens.add(btnNewButton_1);
		
		JButton btnNewButton_2 = new JButton("New button");
		panelMensagens.add(btnNewButton_2);
		
		JButton btnNewButton_3 = new JButton("New button");
		panelMensagens.add(btnNewButton_3);
		
		JButton btnNewButton_4 = new JButton("New button");
		panelMensagens.add(btnNewButton_4);
		
		JButton btnNewButton_5 = new JButton("New button");
		panelMensagens.add(btnNewButton_5);
		GroupLayout gl_tabelaMenuPrincipal = new GroupLayout(tabelaMenuPrincipal);
		gl_tabelaMenuPrincipal.setHorizontalGroup(
			gl_tabelaMenuPrincipal.createParallelGroup(Alignment.LEADING)
				.addComponent(panelMensagens, GroupLayout.PREFERRED_SIZE, 513, GroupLayout.PREFERRED_SIZE)
		);
		gl_tabelaMenuPrincipal.setVerticalGroup(
			gl_tabelaMenuPrincipal.createParallelGroup(Alignment.LEADING)
				.addComponent(panelMensagens, GroupLayout.PREFERRED_SIZE, 429, GroupLayout.PREFERRED_SIZE)
		);
		tabelaMenuPrincipal.setLayout(gl_tabelaMenuPrincipal);
		
		GroupLayout gl_menuPrincipal = new GroupLayout(menuPrincipal);
		gl_menuPrincipal.setHorizontalGroup(
			gl_menuPrincipal.createParallelGroup(Alignment.LEADING)
				.addComponent(panelMenuPrincipal, GroupLayout.PREFERRED_SIZE, 285, GroupLayout.PREFERRED_SIZE)
		);
		gl_menuPrincipal.setVerticalGroup(
			gl_menuPrincipal.createParallelGroup(Alignment.LEADING)
				.addComponent(panelMenuPrincipal, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
		);
		
		JButton gerenciamentoCaixa = new JButton("Gerenciamento de Caixa");
		gerenciamentoCaixa.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				
			}
		});
		
		JButton controleCaixa = new JButton("Controle de Caixa");
		controleCaixa.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				
			}
		});
		
		JButton prateleiras = new JButton("Prateleiras");
		prateleiras.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				
			}
		});
		
		JButton contas = new JButton("Contas");
		contas.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				
			}
		});
		
		JButton cadastroProdutos = new JButton("Cadastro de Produtos");
		cadastroProdutos.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				
			}
		});
		
		JButton cadastroFuncionario = new JButton("Cadastro de Funcion\u00E1rio");
		cadastroFuncionario.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				
				
			}
		});
		
		JButton logoff = new JButton("Logoff");
		logoff.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				panelMensagens.setVisible(false);
				setVisible(false);
				TelaInicial telaInicial = new TelaInicial();
				telaInicial.setVisible(true);
				
			}
		});
		
		
		
		GroupLayout gl_panelMenuPrincipal = new GroupLayout(panelMenuPrincipal);
		gl_panelMenuPrincipal.setHorizontalGroup(
			gl_panelMenuPrincipal.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_panelMenuPrincipal.createSequentialGroup()
					.addGap(60)
					.addGroup(gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
						.addComponent(logoff, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
							.addComponent(cadastroFuncionario, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
							.addGroup(gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
								.addComponent(cadastroProdutos, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
								.addGroup(gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
									.addComponent(contas, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
									.addGroup(gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
										.addComponent(prateleiras, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
										.addGroup(gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
											.addComponent(controleCaixa, GroupLayout.PREFERRED_SIZE, 162, GroupLayout.PREFERRED_SIZE)
											.addComponent(gerenciamentoCaixa, GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)))))))
					.addGap(51))
		);
		gl_panelMenuPrincipal.setVerticalGroup(
			gl_panelMenuPrincipal.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panelMenuPrincipal.createSequentialGroup()
					.addGap(22)
					.addComponent(gerenciamentoCaixa, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(controleCaixa, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(prateleiras, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(contas, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(cadastroProdutos, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(cadastroFuncionario, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
					.addComponent(logoff, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
					.addGap(26))
		);
		panelMenuPrincipal.setLayout(gl_panelMenuPrincipal);
		menuPrincipal.setLayout(gl_menuPrincipal);
		contentPane.setLayout(gl_contentPane);
		
		
	}
}